﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;

namespace mozhi.smarterp.AuthorCenter.Users
{
    public class UserTenant : FullAuditedAggregateRoot<Guid>
    {
        public Guid TenantId { get; private set; }

        public Guid UserId { get; private set; }

        public Guid TargetUserId { get; private set; }

        private UserTenant() { }

        public UserTenant(Guid tenantId, Guid userId, Guid targetUserId)
        {
            TenantId = tenantId;
            UserId = userId;
            TargetUserId = targetUserId;
            Validate();
            
        }

        #region
        private void Validate()
        {
            if(TenantId==default)
                throw new ArgumentNullException(nameof(TenantId));

            if(UserId==default)
                throw new ArgumentNullException(nameof(UserId));

            if(TargetUserId==default)
                throw new ArgumentNullException (nameof(TargetUserId));
        }
        #endregion
    }
}
